import { login } from '../../services/user';
Page({
  data: {
    goodsList: [],
    background: [
      {
        id: 1,
        bannerImage: 'https://img.gegejia.com/img/ca89f380afe3060ab8c3fdc2bb588cb3.png'
      }
    ]
  },
  onShow() {
    my.setNavigationBar({
      title: '推荐商品',
      backgroundColor: '#4BA3F9'
    })
    //this.getLocation()

  },
  onLoad(event) {

    let data = JSON.parse(event.data)
    let background = []
    if (data.bannerImage) {
      background.push({ bannerImage: decodeURIComponent(data.bannerImage) })
    }
    this.setData({ background: background, goodsList: data.goodsList })

  },
  onListClick({ target: { dataset } }) {
    const { onClick } = this.data.navList[dataset.index];
    if (onClick) {
      onClick();
    }
  },

  entriesTap(event) {
    console.log(event)
    if (event.target.dataset.url) {
      my.navigateTo({
        url: event.target.dataset.url
      })
    }
  }
});
